import React, { useRef, useState, useEffect } from 'react';
import { connect } from 'umi';
import { Tag, Tooltip } from 'antd';
import TableDataBlock from '@/components/TableDataBlock';
import ManageMash from './components/manageMash';
const Gather = (props) => {
  const { loading, dispatch, list, history } = props;
  const childRef = useRef();
  const handleCallback = () => {
    childRef.current.fetchGetData();
  };
  const [visible, setVisible] = useState(false);
  const extraBtn = [
    {
      text: '选择场景',
      onClick: () => {
        setVisible({
          show: true,
        });
      },
    },
  ];

  const getColumns = [
    {
      title: '名称',
      
      dataIndex: 'id',
    },
    {
      title: '类型',
      
      dataIndex: 'nickname',
    },
    {
      title: '采集页面',
      
      dataIndex: 'organizationUserBindFlag',
    },
    {
      title: '关联时间',
      
      dataIndex: 'username',
    },
    {
      title: '状态',
      
      dataIndex: 'address',
    },
    {
      type: 'handle',
      width: 200,
      dataIndex: 'id',
      render: (val, record) => [
        {
          title: '删除',
          click: () => {},
        },
      ],
    },
  ];
  return (
    <div style={{ marginTop: 12 }}>
      <TableDataBlock
        btnExtra={extraBtn}
        cRef={childRef}
        loading={loading}
        columns={getColumns}
        rowKey={(record) => `${record.cid}`}
        {...list}
      ></TableDataBlock>
      <ManageMash visible={visible} onClose={() => setVisible(false)}></ManageMash>
    </div>
  );
};

export default connect(({ video, weCom, loading }) => ({
  organizationAuthAdminList: weCom.organizationAuthAdminList.list,
  list: video.myCommentList,
  loading: loading.models.video,
}))(Gather);
